//
//  CUIViewEx.m
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-12.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "CUIViewEx.h"

@implementation CUIViewEx

@synthesize m_Target;
@synthesize m_Action;
@synthesize m_Image;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) 
    {
        // Initialization code
        self.backgroundColor = [UIColor clearColor];
        UIView *bkview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        bkview.backgroundColor = [UIColor blackColor];
        bkview.alpha = 0.8;
        [self addSubview:bkview];
        [bkview release];
        
        m_Image = [[UIImageView alloc] initWithFrame:CGRectMake(24, 0, 272, frame.size.height)];
        //m_Image.layer.borderWidth = 2;
        //m_Image.layer.cornerRadius= 2;
        //m_Image.layer.borderColor = [[UIColor whiteColor] CGColor];
        [self addSubview:m_Image];
        [m_Image release];
    }
    return self;
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    if ([touch tapCount] > 1)
    {
        [m_Target performSelector:m_Action];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
